// 递归阶乘 5! = 5  * 4!   4! = 4 * 3!  ...  1! = 1

function factorial(num) {
    if (num == 1) {
        return 1;
    }
    return num * factorial(num - 1);
}

let number = factorial(5);
console.log(number);


